//
// Created by lymk on 2021/8/4.
//

#ifndef GAME2D_GAMEACTOR_H
#define GAME2D_GAMEACTOR_H
#include "../WindowsHandler.h"
#include "../Utils.h"
#include "vector"
#include "../GMath.h"
#include "../Component/PhyComponent.h"
#include "../Component/AnimeComponent.h"

class GameActor {
    //重构
    GMath::Vec2 renderPos;
    GMath::Vec2 actorSpeed;
    GMath::Vec2 collideSize;
    GMath::Vec2 collidePos;

    AnimeComponent* animeComponent;

    float score;
    bool bCanJump;
public:
    const GMath::Vec2 &getRenderPos() const;

    void setRenderPos(const GMath::Vec2 &renderPos);

    const GMath::Vec2 &getActorSpeed() const;

    void setActorSpeed(const GMath::Vec2 &actorSpeed);

    const GMath::Vec2 &getCollideSize() const;

    void setCollideSize(const GMath::Vec2 &collideSize);

    const GMath::Vec2 &getCollidePos() const;

    void setCollidePos(const GMath::Vec2 &collidePos);

    float getScore() const;

    void setScore(float score);

private:
    int jump_flag = false;
public:
    void Initialize(std::string path,GMath::Vec2 initPos,GMath::Vec2 sp);

    void HandleInput(InputManager* manager);

    void update(double DeltaSeconds,RenderUtils renderUtils,InputManager* manager,PhyComponent* worldCollide);

    void HandleMove(double DeltaSeconds,PhyComponent* worldCollide);

    void Finalize();
};


#endif //GAME2D_GAMEACTOR_H
